﻿namespace Armon.Lib.Algorithm
{
    public class Node
    {
        public string Value { get; set; }
        public Node? Left { get; set; }
        public Node? Right { get; set; }

        public bool IsLeaf => Left is null && Right is null;

        public bool IsNumber => decimal.TryParse(this.Value, out _);

        public Node(string value)
        {
            this.Value = value;
        }

        public Node(string value, Node left, Node right)
        {
            this.Value = value;
            this.Left = left;
            this.Right = right;
        }
    }
}
